home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / ACL / Animation Class Library / Headers / AnimMask.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  2.5 KB  |  98 lines  |  [TEXT/MPCC]

  1.  
  2. /********************************************
  3.  **** Animation Class Library V1.0 © 1994 Yves Schmid & Alia Development
  4.  ****
  5.  **** AnimMask.h
  6.  ****
  7.  **** Created:      02 June 1994
  8.  **** Modified:     02 September 1994
  9.  **** Version:      0
  10.  **** Compatible:   C++, Mac System 7
  11.  ****
  12.  **** Description:  AnimMask is a special kind of animation which allows you to 
  13.  ****                mask other animation objects.
  14.  ****
  15.  ****                AnimMask is a child class of the AnimCObject class.
  16.  ****
  17.  *******************/
  18.  
  19. #ifndef AnimMask_H
  20. #define AnimMask_H
  21.  
  22.  
  23. #include "AnimCObject.h"
  24. #include "AnimGfx.h"
  25.  
  26. class AnimBase;
  27.  
  28. class AnimMask: public AnimCObject
  29. {
  30.  
  31.     //***********************************************************
  32.     //.............. P U B L I C   M E T H O D S.................
  33.  
  34.     public:
  35.  
  36.  
  37.     // Datas passed are copied, so you don't have to keep them in memory.
  38.  
  39.     AnimMask(AnimSupervisor *base, long resID);        // Initializes with a PICT resource
  40.     AnimMask(AnimSupervisor *base, AnimGfx *agfx);    // Initializes with an AnimGfx object
  41.     AnimMask(AnimSupervisor *base);                    // Empty mask
  42.  
  43.     ~AnimMask(void);
  44.  
  45.  
  46.     // Datas passed are copied, so you don't have to keep them in memory.
  47.  
  48.     void setmask(long resID);        // Installs with a PICT resource
  49.     void setmask(AnimGfx *agfx);    // Installs with an AnimGfx object
  50.     void purge(void);                // The mask bitmap is deleted
  51.  
  52.  
  53.     void findmaxsize(short *width, short *height) const; // Finds the maximum pixels size of the
  54.                                                          // object.
  55.                                                          // You can pass NULL pointers.     
  56.  
  57.     void findcursize(short *width, short *height);          // Finds the maximum pixels size of the
  58.                                                          // object in his current state.
  59.                                                          // You can pass NULL pointers.     
  60.  
  61.     void findcurrect(Rect *rect); // Finds the visual rect of the
  62.                                   // object in his current state.
  63.  
  64.     // Gets/sets mask offset
  65.  
  66.     inline short getoffsetx(void) const {return offsetx;}
  67.     inline short getoffsety(void) const {return offsety;}
  68.  
  69.     inline void setoffsetx(const short x) {offsetx = x;}
  70.     inline void setoffsety(const short y) {offsety = y;}
  71.  
  72.  
  73.     //***********************************************************
  74.  
  75.     //..........................................................
  76.     // You should not call the following methods!
  77.  
  78.     Boolean draw(short basex =0, short basey =0);    
  79.     virtual void getcollisionmask(BitMap **b, unsigned long **linemask, Rect *);
  80.  
  81.     //..........................................................
  82.  
  83.     private:
  84.  
  85.     BitMap            *bitmap;            
  86.     unsigned long    *linemask;            
  87.     short            offsetx,offsety;    
  88.                                         
  89.  
  90.     void setmask(BitMap *bitmap, 
  91.                  unsigned long *linemask);    
  92.  
  93. };
  94.  
  95.  
  96. #endif
  97.  
  98.